#include "dlg_message.h"
#include "ui_dlg_message.h"

dlg_Message::dlg_Message(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::dlg_Message)
{
    ui->setupUi(this);
    ui->tableWidget_message->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
    ui->tableWidget_message->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
}

dlg_Message::~dlg_Message()
{
    delete ui;
}

void dlg_Message::initQSS()
{
    this->setStyleSheet(sys_Data::getInstance()->getThemeQss());
}

void dlg_Message::setMessage(anls_Data &_data)
{
    for(int i = 0; i < 6; i++) { //设置信息表格
        ui->tableWidget_message->setItem(
            i, 0, new QTableWidgetItem(QString::number(_data.volume[i], 'f', 2)));
        ui->tableWidget_message->setItem(
            i, 1, new QTableWidgetItem(QString::number(_data.lesionVolume[i], 'f', 2)));
        ui->tableWidget_message->setItem(
            i, 2, new QTableWidgetItem(QString::number(_data.lesionDensity[i], 'f', 2)));
    }
}
